<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<!-- modify by zhangwei -->
<!-- 百度站长 -->
<meta name="baidu-site-verification" content="MdPKZBgY0U">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">



  <meta name="google-site-verification" content="8DKRuNxJDPU2k6cNyVhLe_eSqGk-R8oiYk8iKMg5gwI">














  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/uploads/favicon.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/uploads/favicon.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/uploads/favicon.ico?v=5.1.4">


  <link rel="mask-icon" href="/uploads/favicon.ico?v=5.1.4" color="#222">





  <meta name="keywords" content="Android图表,MPAndroidChart,">





  <link rel="alternate" href="/atom.xml" title="班德尔城" type="application/atom+xml">






<meta name="description" content="MPAndroidChart图表库的使用">
<meta name="keywords" content="Android图表,MPAndroidChart">
<meta property="og:type" content="article">
<meta property="og:title" content="Android图表库-MPAndroidChart">
<meta property="og:url" content="https://tiimor.cn/Android图表库-MPAndroidChart/index.html">
<meta property="og:site_name" content="班德尔城">
<meta property="og:description" content="MPAndroidChart图表库的使用">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://cdn.tiimor.cn/images/MPAndroidChart.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/LineChart1.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/LineChart2.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/LineChart3.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/LineChart4.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Combined-Chart.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/BarChart1.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/BarChart2.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/Horizontal-BarChart.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/PieChart.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/ScatterChart.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/CandleStickChart.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/BubbleChart.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/RadarChart.png">
<meta property="og:updated_time" content="2019-03-17T06:47:42.363Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Android图表库-MPAndroidChart">
<meta name="twitter:description" content="MPAndroidChart图表库的使用">
<meta name="twitter:image" content="http://cdn.tiimor.cn/images/MPAndroidChart.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '3AUIZWGETM',
      apiKey: '5fcd6d51d892fffe3480c5b37f5fd4fa',
      indexName: 'Tiimor',
      hits: {"per_page":8},
      labels: {"input_placeholder":"搜索","hits_empty":"未发现与「${query}」相关的内容","hits_stats":"${hits} 条相关条目，使用了 ${time} 毫秒"}
    }
  };
</script>



  <link rel="canonical" href="https://tiimor.cn/Android图表库-MPAndroidChart/">





  <title>Android图表库-MPAndroidChart | 班德尔城</title>
  




<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-96457043-1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?abb97f8f68c9e5eb2217d3111c64e696";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

  <!-- modify by zhangwei -->
  <!-- 下雪的动画 -->
  <div class="canvas-snow">
    <canvas id="canvas" style="margin: 0;  padding: 0;top:0; left: 0; right: 0; background: transparent; position: absolute;" width="1366" height="105"></canvas>
      <script>

      var canvasBgImg = {
        start: function () {
          this.canvas = document.getElementById('canvas')
          this.ctx = this.canvas.getContext("2d")
          this.canvas.width = window.innerWidth
          this.canvas.height = 105
          this.starList = []
        },
        drawLine: function (ctx, x1, y1, x2, y2) {
          ctx.beginPath()
          ctx.strokeStyle = '#ffffff'
          ctx.lineTo(x1, y1)
          ctx.lineTo(x2, y2)
          ctx.stroke()
        },
        canvasSingleSnow: function (snowSize) {
          var singleSnow = document.createElement('canvas'),
            ctxSingle = singleSnow.getContext('2d')
          singleSnow.setAttribute('width', snowSize * 2)
          singleSnow.setAttribute('height', snowSize * 2)
          for (var i = 0; i < 6; i++) {
            ctxSingle.save()
            ctxSingle.translate(snowSize, snowSize)
            ctxSingle.rotate(Math.PI * 2 * i / 6)
            this.drawLine(ctxSingle, 0, 0, snowSize, 0)
            ctxSingle.restore()
          }
          return singleSnow
        },
        canvasAllSnow: function (centerSnow) {
          var canvasSnow = document.createElement('canvas'),
            ctxSnow = canvasSnow.getContext('2d'),
            bigSnow = this.canvasSingleSnow(centerSnow),
            smallSnow = this.canvasSingleSnow(centerSnow / 3),
            sizeSnow = centerSnow * 3 / 5,
            rSnow = centerSnow - sizeSnow / 2
          canvasSnow.setAttribute('width', centerSnow * 2)
          canvasSnow.setAttribute('height', centerSnow * 2)
          ctxSnow.drawImage(bigSnow, 0, 0, bigSnow.width, bigSnow.height, 0, 0, centerSnow * 2, centerSnow * 2)
          for (var i = 0; i < 6; i++) {
            ctxSnow.save()
            ctxSnow.translate(centerSnow, centerSnow)
            ctxSnow.rotate(Math.PI * 2 * i / 6)
            ctxSnow.drawImage(smallSnow, 0, 0, smallSnow.width, smallSnow.height, rSnow - sizeSnow / 2,
              -sizeSnow / 2, sizeSnow, sizeSnow)
            ctxSnow.restore()
          }
          return canvasSnow
        },
        init: function () {
          this.start()
          for (var i = 0; i < 75; i++) {
            this.starList.push({
              drawFunc: this.canvasAllSnow(15),
              width: Math.random() * this.canvas.width,
              height: Math.random() * this.canvas.height,
              speed: Math.random() * 1.5 + .5,
              scale: Math.random() * 12 + 5,
              angel: 0
            })
          }
          var self = this,
            loop = function () {
              self.ctx.clearRect(0, 0, self.canvas.width, self.canvas.width)
              for (var i = 0; i < 75; i++) {
                self.ctx.save()
                self.starList[i].height = self.starList[i].height + self.starList[i].speed
                self.starList[i].angel += 2
                self.ctx.translate(self.starList[i].width, self.starList[i].height)
                self.ctx.rotate(self.starList[i].angel * Math.PI / 360)
                self.ctx.translate(-self.starList[i].width, -self.starList[i].height)
                self.ctx.drawImage(self.starList[i].drawFunc, 0, 0,
                  self.starList[i].drawFunc.width, self.starList[i].drawFunc.height,
                  self.starList[i].width - self.starList[i].scale / 2,
                  self.starList[i].height - self.starList[i].scale / 2,
                  self.starList[i].scale, self.starList[i].scale)
                if (self.starList[i].height > self.canvas.height) {
                  self.starList[i] = Object.assign(self.starList[i], {
                    height: -self.starList[i].scale,
                    width: Math.random() * this.canvas.width
                  })
                }
                self.ctx.restore()
              }
              requestAnimationFrame(loop)
            }
          requestAnimationFrame(loop)
        }
      }
      canvasBgImg.init()
      </script>

    </div>


    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <!-- modify by zhangwei -->
        <!-- 圣诞帽 -->
        <img src="/uploads/santa-hat.png" id="santa" style="height: 41px; position: absolute; left: -40px; top: -20px; transform: rotate(-45deg); z-index: 9000;">

        <span class="logo-line-before"><i></i></span>
        <span class="site-title">班德尔城</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">微笑，简单，奋发</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-guestbook">
          <a href="/guestbook" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-send"></i> <br>
            
            留言
          </a>
        </li>
      
        
        <li class="menu-item menu-item-favourite">
          <a href="/favourite" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-bookmark"></i> <br>
            
            收藏
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br>
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  
  <div class="algolia-popup popup search-popup">
    <div class="algolia-search">
      <div class="algolia-search-input-icon">
        <i class="fa fa-search"></i>
      </div>
      <div class="algolia-search-input" id="algolia-search-input"></div>
    </div>

    <div class="algolia-results">
      <div id="algolia-stats"></div>
      <div id="algolia-hits"></div>
      <div id="algolia-pagination" class="algolia-pagination"></div>
    </div>

    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
  </div>




    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://tiimor.cn/Android图表库-MPAndroidChart/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Tiimor">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/uploads/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="班德尔城">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Android图表库-MPAndroidChart</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-12-10T14:29:46+08:00">
                2017-12-10
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Android联盟/" itemprop="url" rel="index">
                    <span itemprop="name">Android联盟</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/Android图表库-MPAndroidChart/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count gitment-comments-count" data-xid="/Android图表库-MPAndroidChart/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          
          
             <span id="/Android图表库-MPAndroidChart/" class="leancloud_visitors" data-flag-title="Android图表库-MPAndroidChart">
               <span class="post-meta-divider">|</span>
               <!-- modify by zhangwei -->
               <!-- 去掉阅读的眼睛图标，阅读次数改为℃ -->
			   
                 <span class="post-meta-item-text">热度 </span>
               
                 <span class="leancloud-visitors-count"></span>
				 <span>℃</span>
             </span>
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p><img src="http://cdn.tiimor.cn/images/MPAndroidChart.png" alt="Android" title="MPAndroidChart"></p>
<p><strong><a href="https://github.com/PhilJay/MPAndroidChart" target="_blank" rel="noopener">MPAndroidChart</a>&#x56FE;&#x8868;&#x5E93;&#x7684;&#x4F7F;&#x7528;</strong></p>
<a id="more"></a>
<p>MPAndroidChart&#x662F;&#x4E00;&#x6B3E;&#x57FA;&#x4E8E;Android&#x7684;&#x5F00;&#x6E90;&#x56FE;&#x8868;&#x5E93;&#xFF0C;MPAndroidChart&#x4E0D;&#x4EC5;&#x53EF;&#x4EE5;&#x5728;Android&#x8BBE;&#x5907;&#x4E0A;&#x7ED8;&#x5236;&#x5404;&#x79CD;&#x7EDF;&#x8BA1;&#x56FE;&#x8868;&#xFF0C;&#x800C;&#x4E14;&#x53EF;&#x4EE5;&#x5BF9;&#x56FE;&#x8868;&#x8FDB;&#x884C;&#x62D6;&#x52A8;&#x548C;&#x7F29;&#x653E;&#x64CD;&#x4F5C;&#xFF0C;&#x5E94;&#x7528;&#x8D77;&#x6765;&#x975E;&#x5E38;&#x7075;&#x6D3B;&#x3002;MPAndroidChart&#x663E;&#x5F97;&#x66F4;&#x4E3A;&#x8F7B;&#x5DE7;&#x548C;&#x7B80;&#x5355;&#xFF0C;&#x62E5;&#x6709;&#x5E38;&#x7528;&#x7684;&#x56FE;&#x8868;&#x7C7B;&#x578B;&#xFF1A;&#x7EBF;&#x578B;&#x56FE;&#x3001;&#x997C;&#x56FE;&#x3001;&#x67F1;&#x72B6;&#x56FE;&#x548C;&#x6563;&#x70B9;&#x56FE;&#x3002;</p>
<h1 id="&#x6838;&#x5FC3;&#x529F;&#x80FD;"><a href="#&#x6838;&#x5FC3;&#x529F;&#x80FD;" class="headerlink" title="&#x6838;&#x5FC3;&#x529F;&#x80FD;"></a>&#x6838;&#x5FC3;&#x529F;&#x80FD;</h1><ul>
<li>&#x652F;&#x6301;x&#xFF0C;y&#x8F74;&#x7F29;&#x653E;</li>
<li>&#x652F;&#x6301;&#x62D6;&#x62FD;</li>
<li>&#x652F;&#x6301;&#x624B;&#x6307;&#x6ED1;&#x52A8;</li>
<li>&#x652F;&#x6301;&#x9AD8;&#x4EAE;&#x663E;&#x793A;</li>
<li>&#x652F;&#x6301;&#x4FDD;&#x5B58;&#x56FE;&#x8868;&#x5230;&#x6587;&#x4EF6;&#x4E2D;</li>
<li>&#x652F;&#x6301;&#x4ECE;&#x6587;&#x4EF6;&#xFF08;txt&#xFF09;&#x4E2D;&#x8BFB;&#x53D6;&#x6570;&#x636E;</li>
<li>&#x9884;&#x5148;&#x5B9A;&#x4E49;&#x989C;&#x8272;&#x6A21;&#x677F;</li>
<li>&#x81EA;&#x52A8;&#x751F;&#x6210;&#x6807;&#x6CE8;</li>
<li>&#x652F;&#x6301;&#x81EA;&#x5B9A;&#x4E49;x&#xFF0C;y&#x8F74;&#x7684;&#x663E;&#x793A;&#x6807;&#x7B7E;</li>
<li>&#x652F;&#x6301;x&#xFF0C;y&#x8F74;&#x52A8;&#x753B;</li>
<li>&#x652F;&#x6301;x&#xFF0C;y&#x8F74;&#x8BBE;&#x7F6E;&#x6700;&#x5927;&#x503C;&#x548C;&#x9644;&#x52A0;&#x4FE1;&#x606F;</li>
<li>&#x652F;&#x6301;&#x81EA;&#x5B9A;&#x4E49;&#x5B57;&#x4F53;&#xFF0C;&#x989C;&#x8272;&#xFF0C;&#x80CC;&#x666F;&#xFF0C;&#x624B;&#x52BF;&#xFF0C;&#x865A;&#x7EBF;&#x7B49;</li>
</ul>
<h1 id="&#x56FE;&#x8868;&#x7C7B;&#x578B;"><a href="#&#x56FE;&#x8868;&#x7C7B;&#x578B;" class="headerlink" title="&#x56FE;&#x8868;&#x7C7B;&#x578B;"></a>&#x56FE;&#x8868;&#x7C7B;&#x578B;</h1><ul>
<li><p>LineChart (with legend, simple design)<br><img src="http://cdn.tiimor.cn/images/LineChart1.png" alt="LineChart1"></p>
</li>
<li><p>LineChart (with legend, simple design)<br><img src="http://cdn.tiimor.cn/images/LineChart2.png" alt="LineChart2"></p>
</li>
<li><p>LineChart (cubic lines)<br><img src="http://cdn.tiimor.cn/images/LineChart3.png" alt="LineChart3"></p>
</li>
<li><p>LineChart (gradient fill)<br><img src="http://cdn.tiimor.cn/images/LineChart4.png" alt="LineChart4"></p>
</li>
<li><p>Combined-Chart (bar- and linechart in this case)<br><img src="http://cdn.tiimor.cn/images/Combined-Chart.png" alt="Combined-Chart"></p>
</li>
<li><p>BarChart (with legend, simple design)<br><img src="http://cdn.tiimor.cn/images/BarChart1.png" alt="BarChart1"></p>
</li>
<li><p>BarChart (grouped DataSets)<br><img src="http://cdn.tiimor.cn/images/BarChart2.png" alt="BarChart2"></p>
</li>
<li><p>Horizontal-BarChart<br><img src="http://cdn.tiimor.cn/images/Horizontal-BarChart.png" alt="Horizontal-BarChart"></p>
</li>
<li><p>PieChart (with selection, &#x2026;)<br><img src="http://cdn.tiimor.cn/images/PieChart.png" alt="PieChart"></p>
</li>
<li><p>ScatterChart (with squares, triangles, circles, &#x2026; and more)<br><img src="http://cdn.tiimor.cn/images/ScatterChart.png" alt="ScatterChart"></p>
</li>
<li><p>CandleStickChart (for financial data)<br><img src="http://cdn.tiimor.cn/images/CandleStickChart.png" alt="CandleStickChart"></p>
</li>
<li><p>BubbleChart (area covered by bubbles indicates the yValue)<br><img src="http://cdn.tiimor.cn/images/BubbleChart.png" alt="BubbleChart"></p>
</li>
<li><p>RadarChart (spider web chart)<br><img src="http://cdn.tiimor.cn/images/RadarChart.png" alt="RadarChart"></p>
</li>
</ul>
<h1 id="&#x56FE;&#x8868;&#x7ED8;&#x5236;"><a href="#&#x56FE;&#x8868;&#x7ED8;&#x5236;" class="headerlink" title="&#x56FE;&#x8868;&#x7ED8;&#x5236;"></a>&#x56FE;&#x8868;&#x7ED8;&#x5236;</h1><h2 id="XY&#x8F74;&#x7ED8;&#x5236;"><a href="#XY&#x8F74;&#x7ED8;&#x5236;" class="headerlink" title="XY&#x8F74;&#x7ED8;&#x5236;"></a>XY&#x8F74;&#x7ED8;&#x5236;</h2><ul>
<li><code>setEnabled(boolean enabled)</code>:&#x8BBE;&#x7F6E;&#x8F74;&#x662F;&#x5426;&#x88AB;&#x7ED8;&#x5236;&#x3002;&#x9ED8;&#x8BA4;&#x7ED8;&#x5236;,false&#x4E0D;&#x4F1A;&#x88AB;&#x7ED8;&#x5236;&#x3002;</li>
<li><code>setDrawLabels(boolean enabled)</code>:&#x8BBE;&#x7F6E;&#x4E3A;true&#x6253;&#x5F00;&#x7ED8;&#x5236;&#x8F74;&#x7684;&#x6807;&#x7B7E;&#x3002;</li>
<li><code>setDrawAxisLine(boolean enabled)</code>:&#x8BBE;&#x7F6E;&#x4E3A;true&#xFF0C;&#x7ED8;&#x5236;&#x8F74;&#x7EBF;</li>
<li><code>setDrawGridLines(boolean enabled)</code>:&#x8BBE;&#x7F6E;&#x4E3A;true&#x7ED8;&#x5236;&#x7F51;&#x683C;&#x7EBF;&#x3002;</li>
</ul>
<h2 id="&#x5B9A;&#x4E49;&#x8F74;&#x7EBF;&#x6837;&#x5F0F;"><a href="#&#x5B9A;&#x4E49;&#x8F74;&#x7EBF;&#x6837;&#x5F0F;" class="headerlink" title="&#x5B9A;&#x4E49;&#x8F74;&#x7EBF;&#x6837;&#x5F0F;"></a>&#x5B9A;&#x4E49;&#x8F74;&#x7EBF;&#x6837;&#x5F0F;</h2><ul>
<li><code>setTextColor(int color)</code>:&#x8BBE;&#x7F6E;&#x8F74;&#x6807;&#x7B7E;&#x6587;&#x672C;&#x989C;&#x8272;&#x3002;</li>
<li><code>setTextSize(float size)</code>:&#x8BBE;&#x7F6E;&#x8F74;&#x6807;&#x7B7E;&#x7684;&#x5B57;&#x4F53;&#x5927;&#x5C0F;&#x3002;</li>
<li><code>setTypeface(Typeface tf)</code>:&#x8BBE;&#x7F6E;&#x8F74;&#x6807;&#x7B7E;&#x7684;&#x81EA;&#x5B9A;&#x4E49;Typeface</li>
<li><code>setGridColor(int color)</code>:&#x8BBE;&#x7F6E;&#x7F51;&#x683C;&#x7EBF;&#x989C;&#x8272;&#x3002;</li>
<li><code>setGridLineWidth(float width)</code>:&#x8BBE;&#x7F6E;&#x7F51;&#x683C;&#x7EBF;&#x5BBD;&#x5EA6;&#x3002;</li>
<li><code>setAxisLineColor(int color)</code>:&#x8BBE;&#x7F6E;&#x6B64;&#x8F74;&#x7684;&#x5750;&#x6807;&#x8F74;&#x7684;&#x989C;&#x8272;&#x3002;</li>
<li><code>setAxisLineWidth(float width)</code>:&#x8BBE;&#x7F6E;&#x6B64;&#x8F74;&#x7684;&#x5750;&#x6807;&#x8F74;&#x7684;&#x5BBD;&#x5EA6;&#x3002;</li>
<li><code>setVisibleXRangeMaximum(float maxXRange)</code>:&#x8BBE;&#x7F6E;x&#x8F74;&#x6700;&#x591A;&#x663E;&#x793A;&#x6570;&#x636E;&#x6761;&#x6570;&#xFF0C;&#xFF08;&#x8981;&#x5728;&#x8BBE;&#x7F6E;&#x6570;&#x636E;&#x6E90;&#x540E;&#x8C03;&#x7528;&#xFF0C;&#x5426;&#x5219;&#x662F;&#x65E0;&#x6548;&#x7684;&#xFF09;</li>
<li><code>enableGridDashedLine(float lineLength, float spaceLength, float phase)</code>:&#x663E;&#x793A;&#x7F51;&#x683C;&#x7EBF;&#x865A;&#x7EBF;&#x6A21;&#x5F0F;&#xFF0C;&#x201C;lineLength&#x201D;&#x63A7;&#x5236;&#x77ED;&#x7EBF;&#x6761;&#x7684;&#x957F;&#x5EA6;&#xFF0C;&#x201C;spaceLength&#x201D;&#x63A7;&#x5236;&#x4E24;&#x6BB5;&#x7EBF;&#x4E4B;&#x95F4;&#x7684;&#x95F4;&#x9694;&#x957F;&#x5EA6;&#xFF0C;&#x201C;phase&#x201D;&#x63A7;&#x5236;&#x5F00;&#x59CB;&#x7684;&#x70B9;&#x3002;</li>
</ul>
<h2 id="&#x81EA;&#x5B9A;&#x4E49;&#x8F74;&#x7EBF;&#x7684;&#x503C;"><a href="#&#x81EA;&#x5B9A;&#x4E49;&#x8F74;&#x7EBF;&#x7684;&#x503C;" class="headerlink" title="&#x81EA;&#x5B9A;&#x4E49;&#x8F74;&#x7EBF;&#x7684;&#x503C;"></a>&#x81EA;&#x5B9A;&#x4E49;&#x8F74;&#x7EBF;&#x7684;&#x503C;</h2><ul>
<li><code>setAdjustXLabels(boolean enabled)</code>:&#x5982;&#x679C;&#x88AB;&#x8BBE;&#x7F6E;&#x4E3A;true&#xFF0C;x&#x8F74;&#x6761;&#x76EE;&#x5C06;&#x4F9D;&#x8D56;&#x4E8E;&#x5B83;&#x81EA;&#x5DF1;&#x5728;&#x8FDB;&#x884C;&#x7F29;&#x653E;&#x7684;&#x65F6;&#x5019;&#x3002;&#x5982;&#x679C;&#x8BBE;&#x7F6E;&#x4E3A;false&#xFF0C;x&#x8F74;&#x6761;&#x76EE;&#x5C06;&#x603B;&#x662F;&#x4FDD;&#x6301;&#x76F8;&#x540C;&#x3002;</li>
<li><code>setAvoidFirstLastClipping(boolean enabled)</code>:&#x5982;&#x679C;&#x8BBE;&#x7F6E;&#x4E3A;true&#xFF0C;&#x56FE;&#x8868;&#x5C06;&#x907F;&#x514D;&#x7B2C;&#x4E00;&#x4E2A;&#x548C;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x6807;&#x7B7E;&#x6761;&#x76EE;&#x88AB;&#x51CF;&#x6389;&#x5728;&#x56FE;&#x8868;&#x6216;&#x5C4F;&#x5E55;&#x7684;&#x8FB9;&#x7F18;&#x3002;</li>
<li><code>setSpaceBetweenLabels(int characters)</code>:&#x8BBE;&#x7F6E;x&#x8F74;&#x6807;&#x7B7E;&#x4E4B;&#x95F4;&#x7684;&#x7A7A;&#x95F4;&#x5B57;&#x7B26;&#x6570;&#xFF0C;&#x9ED8;&#x8BA4;&#x662F;4&#x4E2A;&#x3002;</li>
<li><code>setPosition(XAxisPosition pos)</code>:&#x8BBE;&#x7F6E;XAxis&#x5E94;&#x8BE5;&#x51FA;&#x73B0;&#x7684;&#x4F4D;&#x7F6E;&#x3002;&#x53EF;&#x4EE5;&#x9009;&#x62E9;TOP&#xFF0C;BOTTOM&#xFF0C;BOTH_SIDED&#xFF0C;TOP_INSIDE&#x6216;&#x8005;BOTTOM_INSIDE&#x3002;</li>
<li><code>setStartAtZero(boolean enabled)</code>:&#x5982;&#x679C;&#x8FD9;&#x4E2A;&#x6253;&#x5F00;&#xFF0C;&#x8F74;&#x7EBF;&#x603B;&#x662F;&#x6709;&#x6700;&#x5C0F;&#x503C;0,&#x65E0;&#x8BBA;&#x4EC0;&#x4E48;&#x7C7B;&#x578B;&#x7684;&#x56FE;&#x8868;&#x88AB;&#x5C55;&#x793A;&#x3002;</li>
<li><code>setAxisMaxValue(float max)</code>:&#x8BBE;&#x7F6E;&#x4E00;&#x4E2A;&#x81EA;&#x5B9A;&#x4E49;&#x7684;&#x6700;&#x5927;&#x503C;&#x4E3A;&#x8FD9;&#x6761;&#x8F74;&#xFF0C;&#x5982;&#x679C;&#x8BBE;&#x7F6E;&#x4E86;&#xFF0C;&#x8FD9;&#x4E2A;&#x503C;&#x5C06;&#x4E0D;&#x4F1A;&#x4F9D;&#x8D56;&#x4E8E;&#x63D0;&#x4F9B;&#x7684;&#x6570;&#x636E;&#x81EA;&#x52A8;&#x8BA1;&#x7B97;&#x3002;</li>
<li><code>resetAxisMaxValue()</code>:&#x8C03;&#x7528;&#x8FD9;&#x4E2A;&#x5C06;&#x64A4;&#x9500;&#x4EE5;&#x524D;&#x8BBE;&#x7F6E;&#x7684;&#x6700;&#x5927;&#x503C;&#x3002;&#x8FD9;&#x610F;&#x5473;&#x7740;&#xFF0C;&#x4F60;&#x5C06;&#x518D;&#x6B21;&#x5141;&#x8BB8;&#x8F74;&#x81EA;&#x52A8;&#x8BA1;&#x7B97;&#x5B83;&#x7684;&#x6700;&#x5927;&#x503C;&#x3002;</li>
<li><code>setAxisMinValue(float min)</code>:&#x8BBE;&#x7F6E;&#x4E00;&#x4E2A;&#x81EA;&#x5B9A;&#x4E49;&#x7684;&#x6700;&#x5C0F;&#x503C;&#x3002;&#x5982;&#x679C;&#x8BBE;&#x7F6E;&#x4E86;&#xFF0C;&#x8FD9;&#x4E2A;&#x503C;&#x5C06;&#x4E0D;&#x4F1A;&#x4F9D;&#x8D56;&#x4E8E;&#x4F60;&#x63D0;&#x4F9B;&#x7684;&#x6570;&#x636E;&#x8FDB;&#x884C;&#x81EA;&#x52A8;&#x8BA1;&#x7B97;&#x3002;</li>
<li><code>resetAxisMinValue()</code>:&#x8C03;&#x7528;&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x64A4;&#x9500;&#x4EE5;&#x524D;&#x8BBE;&#x7F6E;&#x7684;&#x6700;&#x5C0F;&#x503C;&#x3002;&#x8FD9;&#x610F;&#x5473;&#x7740;&#xFF0C;&#x4F60;&#x5C06;&#x518D;&#x6B21;&#x5141;&#x8BB8;&#x8F74;&#x81EA;&#x52A8;&#x8BA1;&#x7B97;&#x4ED6;&#x7684;&#x6700;&#x5C0F;&#x503C;&#x3002;</li>
<li><code>setInverted(boolean enabled)</code>:&#x5982;&#x679C;&#x8BBE;&#x7F6E;&#x4E3A;true&#xFF0C;&#x8FD9;&#x4E2A;&#x8F74;&#x5C06;&#x88AB;&#x53CD;&#x5411;&#xFF0C;&#x90A3;&#x610F;&#x5473;&#x7740;&#x6700;&#x9AD8;&#x51FA;&#x7684;&#x5C06;&#x5230;&#x5E95;&#x90E8;&#xFF0C;&#x6700;&#x4F4E;&#x90E8;&#x7684;&#x5230;&#x9876;&#x7AEF;&#x3002;</li>
<li><code>setSpaceTop(float percent)</code>:&#x8BBE;&#x7F6E;&#x5728;&#x56FE;&#x8868;&#x4E0A;&#x6700;&#x9AD8;&#x5904;&#x7684;&#x503C;&#x76F8;&#x6BD4;&#x8F74;&#x4E0A;&#x6700;&#x9AD8;&#x503C;&#x7684;&#x9876;&#x7AEF;&#x7A7A;&#x95F4;&#xFF08;&#x603B;&#x8F74;&#x8303;&#x56F4;&#x7684;&#x767E;&#x5206;&#x6BD4;&#xFF09;</li>
<li><code>setSpaceBottom(float percent)</code>:&#x8BBE;&#x7F6E;&#x5728;&#x56FE;&#x8868;&#x4E0A;&#x6700;&#x4F4E;&#x5904;&#x7684;&#x503C;&#x76F8;&#x6BD4;&#x8F74;&#x4E0A;&#x6700;&#x4F4E;&#x5904;&#x503C;&#x7684;&#x5E95;&#x90E8;&#x7A7A;&#x95F4;&#xFF08;&#x603B;&#x8F74;&#x8303;&#x56F4;&#x7684;&#x767E;&#x5206;&#x6BD4;&#xFF09;</li>
<li><code>setShowOnlyMinMax(boolean enabled)</code>:&#x5982;&#x679C;&#x6253;&#x5F00;&#x4E86;&#xFF0C;&#x8FD9;&#x4E2A;&#x8F74;&#x5C06;&#x5C55;&#x793A;&#x51FA;&#x5B83;&#x7684;&#x6700;&#x5C0F;&#x503C;&#x548C;&#x6700;&#x5927;&#x503C;&#x3002;&#x8FD9;&#x5C06;&#x5FFD;&#x7565;&#x6216;&#x8005;&#x8986;&#x76D6;&#x5B9A;&#x4E49;&#x8FC7;&#x7684;label-count&#x3002;</li>
<li><code>setPosition(YAxisLabelPosition pos)</code>:&#x8BBE;&#x7F6E;&#x8F74;&#x6807;&#x7B7E;&#x5E94;&#x8BE5;&#x88AB;&#x7ED8;&#x5236;&#x7684;&#x4F4D;&#x7F6E;&#x3002;INSIDE_CHART&#x6216;&#x8005;OUTSIDE_CHART&#x4E2D;&#x7684;&#x4E00;&#x4E2A;&#x3002; &#x81EA;&#x5B9A;&#x4E49;&#x5F71;&#x54CD;&#x8F74;&#x7684;&#x6570;&#x503C;&#x8303;&#x56F4;&#x5E94;&#x8BE5;&#x5728;&#x56FE;&#x8868;&#x88AB;&#x8BBE;&#x7F6E;&#x6570;&#x636E;&#x4E4B;&#x524D;&#x5E94;&#x7528;&#x3002;</li>
</ul>
<h2 id="&#x56FE;&#x8868;&#x6837;&#x5F0F;"><a href="#&#x56FE;&#x8868;&#x6837;&#x5F0F;" class="headerlink" title="&#x56FE;&#x8868;&#x6837;&#x5F0F;"></a>&#x56FE;&#x8868;&#x6837;&#x5F0F;</h2><p>&#x4E00;&#x4E9B;&#x6837;&#x5F0F;&#x76F8;&#x5173;&#x65B9;&#x6CD5;&#xFF0C;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x4F7F;&#x7528;<br>&#x6709;&#x5173;&#x66F4;&#x8BE6;&#x5C3D;&#x5355;&#x72EC;&#x56FE;&#x8868;&#x7C7B;&#x578B;&#x7684;&#x6837;&#x5F0F;&#x548C;&#x8BBE;&#x7F6E;&#xFF0C;&#x8BF7;&#x770B;&#x770B;&#x5177;&#x4F53;&#x7684;&#x56FE;&#x8868;&#x8BBE;&#x7F6E;&#x7684;wiki&#x9875;&#x9762;<a href="https://github.com/PhilJay/MPAndroidChart/wiki/Specific-chart-settings" target="_blank" rel="noopener">Specific-chart-settings</a></p>
<ul>
<li><code>setBackgroundColor(int color)</code>:&#x8BBE;&#x7F6E;&#x6574;&#x4E2A;&#x56FE;&#x8868;&#x89C6;&#x56FE;&#x7684;&#x80CC;&#x666F;</li>
<li><code>setDescription(String desc)</code>:&#x53F3;&#x4E0B;&#x89D2;&#x5BF9;&#x56FE;&#x8868;&#x7684;&#x63CF;&#x8FF0;&#x4FE1;&#x606F;</li>
<li><code>setDescriptionColor(int color)</code>:&#x63CF;&#x8FF0;&#x4FE1;&#x606F;&#x7684;&#x989C;&#x8272;</li>
<li><code>setDescriptionPosition(float x, float y)</code>:&#x81EA;&#x5B9A;&#x4E49;&#x63CF;&#x8FF0;&#x4FE1;&#x606F;&#x4F4D;&#x7F6E;.</li>
<li><code>setDescriptionTypeface(Typeface t)</code>:&#x81EA;&#x5B9A;&#x4E49;&#x63CF;&#x8FF0;&#x4FE1;&#x606F;&#x5B57;&#x4F53;</li>
<li><code>setDescriptionTextSize(float size)</code>:&#x81EA;&#x5B9A;&#x4E49;&#x63CF;&#x8FF0;&#x4FE1;&#x606F;&#x5B57;&#x4F53;&#x5927;&#x5C0F;, &#x6700;&#x5C0F;&#x503C;6f, &#x6700;&#x5927;&#x503C;16f.</li>
<li><code>setNoDataTextDescription(String desc)</code>:&#x8BBE;&#x7F6E;&#x7A7A;&#x8868;&#x7684;&#x63CF;&#x8FF0;&#x4FE1;&#x606F;</li>
<li><code>setDrawGridBackground(boolean enabled)</code>:&#x662F;&#x5426;&#x7ED8;&#x5236;&#x7F51;&#x683C;&#x80CC;&#x666F;</li>
<li><code>setGridBackgroundColor(int color)</code>:&#x8BBE;&#x7F6E;&#x7F51;&#x683C;&#x80CC;&#x666F;&#x989C;&#x8272;</li>
<li><code>setDrawBorders(boolean enabled)</code>:&#x662F;&#x5426;&#x7ED8;&#x5236;&#x8FB9;&#x7EBF;</li>
<li><code>setBorderColor(int color)</code>:&#x8FB9;&#x7EBF;&#x989C;&#x8272;</li>
<li><code>setBorderWidth(float width)</code>:&#x8FB9;&#x7EBF;&#x5BBD;&#x5EA6;&#xFF0C;&#x5355;&#x4F4D;dp</li>
<li><code>setMaxVisibleValueCount(int count)</code>:&#x8BBE;&#x7F6E;&#x56FE;&#x8868;&#x7ED8;&#x5236;&#x53EF;&#x89C1;&#x6807;&#x7B7E;&#x6570;&#x91CF;&#x6700;&#x5927;&#x503C;. &#x4EC5;&#x5728;setDrawValues() &#x542F;&#x7528;&#x65F6;&#x751F;&#x6548;</li>
</ul>
<h2 id="&#x6253;&#x5370;&#x65E5;&#x5FD7;"><a href="#&#x6253;&#x5370;&#x65E5;&#x5FD7;" class="headerlink" title="&#x6253;&#x5370;&#x65E5;&#x5FD7;"></a>&#x6253;&#x5370;&#x65E5;&#x5FD7;</h2><ul>
<li><code>setLogEnabled(boolean enabled)</code>:&#x8BBE;&#x7F6E;&#x4E3A;true&#x4F1A;&#x6FC0;&#x6D3B;log&#x8F93;&#x51FA;&#x3002;&#x4F7F;&#x7528;&#x8FD9;&#x79CD;log&#x4F1A;&#x5BF9;&#x6027;&#x80FD;&#x9020;&#x6210;&#x5F71;&#x54CD;&#xFF0C;&#x6CA1;&#x6709;&#x5FC5;&#x8981;&#x7528;&#x7684;&#x8BDD;&#x5173;&#x6389;&#x5B83;&#x3002;</li>
</ul>
<h2 id="&#x5237;&#x65B0;"><a href="#&#x5237;&#x65B0;" class="headerlink" title="&#x5237;&#x65B0;"></a>&#x5237;&#x65B0;</h2><ul>
<li><code>invalidate()</code>:&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x80FD;&#x4F7F;&#x56FE;&#x8868;&#x91CD;&#x7ED8;.&#x8981;&#x4F7F;&#x56FE;&#x8868;&#x66F4;&#x6539;&#x751F;&#x6548;&#xFF0C;&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x662F;&#x5FC5;&#x8981;&#x7684;&#x3002;</li>
<li><code>notifyDataSetChanged()</code>:&#x8BA9;&#x56FE;&#x8868;&#x77E5;&#x9053;&#x5B83;&#x7684;&#x57FA;&#x7840;&#x6570;&#x636E;&#x53D1;&#x751F;&#x66F4;&#x6539;&#xFF0C;&#x5E76;&#x6267;&#x884C;&#x6240;&#x6709;&#x5FC5;&#x8981;&#x7684;&#x91CD;&#x65B0;&#x8BA1;&#x7B97;(offsets, legend, maxima, minima, &#x2026;)&#x3002; &#x52A8;&#x6001;&#x6DFB;&#x52A0;&#x6570;&#x636E;&#x65F6;&#xFF0C;&#x8FD9;&#x662F;&#x5FC5;&#x987B;&#x8C03;&#x7528;&#x7684;&#x3002;</li>
</ul>
<h1 id="&#x56FE;&#x8868;&#x7684;&#x4EA4;&#x4E92;"><a href="#&#x56FE;&#x8868;&#x7684;&#x4EA4;&#x4E92;" class="headerlink" title="&#x56FE;&#x8868;&#x7684;&#x4EA4;&#x4E92;"></a>&#x56FE;&#x8868;&#x7684;&#x4EA4;&#x4E92;</h1><h2 id="&#x542F;&#x7528;-&#x7981;&#x7528;&#x4EA4;&#x4E92;"><a href="#&#x542F;&#x7528;-&#x7981;&#x7528;&#x4EA4;&#x4E92;" class="headerlink" title="&#x542F;&#x7528;/&#x7981;&#x7528;&#x4EA4;&#x4E92;"></a>&#x542F;&#x7528;/&#x7981;&#x7528;&#x4EA4;&#x4E92;</h2><ul>
<li><code>setTouchEnabled(boolean enabled)</code>:&#x542F;&#x7528;&#x56FE;&#x8868;&#x89E6;&#x6478;&#x4E8B;&#x4EF6;</li>
<li><code>setDragEnabled(boolean enabled)</code>:&#x542F;&#x7528;&#x56FE;&#x8868;&#x62D6;&#x62FD;&#x4E8B;&#x4EF6;</li>
<li><code>setScaleEnabled(boolean enabled)</code>:&#x542F;&#x7528;&#x56FE;&#x8868;&#x7F29;&#x653E;&#x4E8B;&#x4EF6;</li>
<li><code>setScaleXEnabled(boolean enabled)</code>:&#x542F;&#x7528;X&#x8F74;&#x4E0A;&#x7684;&#x7F29;&#x653E;</li>
<li><code>setScaleYEnabled(boolean enabled)</code>:&#x542F;&#x7528;Y&#x8F74;&#x4E0A;&#x7684;&#x7F29;&#x653E;</li>
<li><code>setPinchZoom(boolean enabled)</code>:XY&#x540C;&#x65F6;&#x7F29;&#x653E;</li>
<li><code>setDoubleTapToZoomEnabled(boolean enabled)</code>:&#x542F;&#x7528;&#x53CC;&#x51FB;&#x7F29;&#x653E;</li>
<li><code>setHighlightPerDragEnabled(boolean enabled)</code>:&#x62D6;&#x62FD;&#x8D85;&#x8FC7;&#x56FE;&#x6807;&#x7ED8;&#x5236;&#x753B;&#x5E03;&#x65F6;&#x9AD8;&#x4EAE;&#x663E;&#x793A;</li>
<li><code>setHighlightPerTapEnabled(boolean enabled)</code>:&#x53CC;&#x51FB;&#x9AD8;&#x4EAE;&#x663E;&#x793A;</li>
</ul>
<h2 id="&#x56FE;&#x8868;&#x7684;&#x51CF;&#x901F;&#x5668;"><a href="#&#x56FE;&#x8868;&#x7684;&#x51CF;&#x901F;&#x5668;" class="headerlink" title="&#x56FE;&#x8868;&#x7684;&#x51CF;&#x901F;&#x5668;"></a>&#x56FE;&#x8868;&#x7684;&#x51CF;&#x901F;&#x5668;</h2><ul>
<li><code>setDragDecelerationEnabled(boolean enabled)</code>:&#x62AC;&#x8D77;&#x4E4B;&#x540E;&#x7EE7;&#x7EED;&#x6EDA;&#x52A8;</li>
<li><code>setDragDecelerationFrictionCoef(float coef)</code>: &#x51CF;&#x901F;&#x63D2;&#x503C;&#xFF0C;&#x53D6;&#x503C;&#x8303;&#x56F4;[0&#xFF0C;1)&#x3002;0&#x8868;&#x793A;&#x7ACB;&#x505C;&#x6B62;&#x3002;&#x503C;&#x8D8A;&#x5927;&#x901F;&#x5EA6;&#x4E0B;&#x964D;&#x8D8A;&#x7F13;&#x6162;</li>
</ul>
<h2 id="&#x9AD8;&#x4EAE;&#x65B9;&#x5F0F;"><a href="#&#x9AD8;&#x4EAE;&#x65B9;&#x5F0F;" class="headerlink" title="&#x9AD8;&#x4EAE;&#x65B9;&#x5F0F;"></a>&#x9AD8;&#x4EAE;&#x65B9;&#x5F0F;</h2><ul>
<li><code>highlightValues(Highlight[] highs)</code>:&#x9AD8;&#x4EAE;&#x70B9;&#x7684;&#x96C6;&#x5408;&#xFF0C;&#x5982;&#x679C;&#x4E3A;&#x7A7A;&#xFF0C;&#x5168;&#x90E8;&#x4E0D;&#x9AD8;&#x4EAE;</li>
<li><code>highlightValue(int xIndex, int dataSetIndex)</code>:x&#x8F74;&#x4E0A;&#x7684;&#x6570;&#x636E;&#x96C6;&#x5408;&#x9AD8;&#x4EAE;&#x3002;&#x5982;&#x679C;&#x4E3A;-1&#xFF0C;&#x5168;&#x90E8;&#x4E0D;&#x9AD8;&#x4E24;</li>
<li><code>getHighlighted()</code>:&#x83B7;&#x53D6;&#x9AD8;&#x4EAE;&#x70B9;&#x7684;&#x96C6;&#x5408;&#xFF0C;&#x9AD8;&#x4EAE;&#x663E;&#x793A;&#x4F7F;&#x7528;OnChartValueSelectedListener&#x4E0D;&#x4F1A;&#x751F;&#x6210;&#x4E00;&#x4E2A;&#x56DE;&#x8C03;&#x3002;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;ChartData&#x6216;DataSet&#x5BF9;&#x8C61;&#x542F;&#x7528;&#x548C;&#x7981;&#x7528;&#x9AD8;&#x4EAE;&#x663E;&#x793A;&#x3002;</li>
</ul>
<h2 id="&#x81EA;&#x5B9A;&#x4E49;&#x9AD8;&#x4EAE;&#x7B26;&#x53F7;"><a href="#&#x81EA;&#x5B9A;&#x4E49;&#x9AD8;&#x4EAE;&#x7B26;&#x53F7;" class="headerlink" title="&#x81EA;&#x5B9A;&#x4E49;&#x9AD8;&#x4EAE;&#x7B26;&#x53F7;"></a>&#x81EA;&#x5B9A;&#x4E49;&#x9AD8;&#x4EAE;&#x7B26;&#x53F7;</h2><p>&#x6240;&#x6709;&#x7684;&#x7528;&#x6237;&#x8F93;&#x5165;&#x5728;&#x5185;&#x90E8;&#x88AB;&#x9ED8;&#x8BA4;ChartHighlighter&#x7C7B;&#x5904;&#x7406;&#x3002;&#x5B83;&#x53EF;&#x4EE5;&#x7528;&#x4E0B;&#x9762;&#x7684;&#x65B9;&#x6CD5;&#x81EA;&#x5B9A;&#x4E49;&#x5B9E;&#x73B0;&#x66FF;&#x6362;&#x9ED8;&#x8BA4;highligher&#xFF1A;</p>
<ul>
<li><code>setHighlighter(ChartHighlighter highlighter)</code>:&#x901A;&#x8FC7;&#x7EE7;&#x627F;ChartHighlighter&#x7C7B;&#x5B9E;&#x73B0;&#x81EA;&#x5B9A;&#x4E49;&#x9AD8;&#x4EAE;&#x7B26;&#x53F7;&#x3002;&#x901A;&#x8FC7;setHighlighter&#x8BBE;&#x7F6E;&#x70B9;&#x51FB;&#x7B49;&#x64CD;&#x4F5C;&#x9AD8;&#x4EAE;&#x663E;&#x793A;&#x7684;&#x7B26;&#x53F7;</li>
</ul>
<h2 id="&#x9009;&#x62E9;&#x56DE;&#x8C03;"><a href="#&#x9009;&#x62E9;&#x56DE;&#x8C03;" class="headerlink" title="&#x9009;&#x62E9;&#x56DE;&#x8C03;"></a>&#x9009;&#x62E9;&#x56DE;&#x8C03;</h2><ul>
<li><code>OnChartValueSelectedListener</code>:&#x89E6;&#x6478;&#x9AD8;&#x4EAE;&#x503C;&#x65F6;&#x56DE;&#x8C03;</li>
</ul>
<h2 id="&#x624B;&#x52BF;&#x56DE;&#x8C03;"><a href="#&#x624B;&#x52BF;&#x56DE;&#x8C03;" class="headerlink" title="&#x624B;&#x52BF;&#x56DE;&#x8C03;"></a>&#x624B;&#x52BF;&#x56DE;&#x8C03;</h2><ul>
<li><code>OnChartGestureListener</code>:&#x8FD9;&#x4E2A;&#x56DE;&#x8C03;&#x53EF;&#x4EE5;&#x5B9A;&#x5236;&#x624B;&#x52BF;&#x64CD;&#x4F5C;&#x76F8;&#x5173;&#x56DE;&#x8C03;&#x3002;&#x6CE8;&#x610F;&#x8BE5;&#x624B;&#x52BF;&#x7684;&#x7F29;&#x653E;&#x662F;&#x5BF9;&#x56FE;&#x8868;&#x7684;Matrix&#x7F29;&#x653E;&#xFF0C;&#x5E76;&#x4E0D;&#x6539;&#x53D8;X&#x8F74;&#x7684;&#x503C;&#xFF0C;&#x5982;&#x679C;&#x60F3;&#x5B9E;&#x73B0;X&#x8F74;&#x6570;&#x503C;&#x53D8;&#x5316;&#x7F29;&#x653E;&#xFF0C;&#x5982;&#x5929;&#x6708;&#x5E74;&#x7684;&#x5207;&#x6362;&#xFF0C;&#x9700;&#x8981;&#x501F;&#x52A9;&#x624B;&#x52BF;&#x7C7B;&#x5B9E;&#x73B0;&#x3002;</li>
</ul>
<h1 id="&#x4E3B;&#x8981;&#x56FE;&#x8868;&#x7C7B;"><a href="#&#x4E3B;&#x8981;&#x56FE;&#x8868;&#x7C7B;" class="headerlink" title="&#x4E3B;&#x8981;&#x56FE;&#x8868;&#x7C7B;"></a>&#x4E3B;&#x8981;&#x56FE;&#x8868;&#x7C7B;</h1><h2 id="&#x8F74;AxisBase"><a href="#&#x8F74;AxisBase" class="headerlink" title="&#x8F74;AxisBase"></a>&#x8F74;AxisBase</h2><p>AxisBase &#x8FD9;&#x4E2A;&#x7C7B;&#xFF0C;&#x4ED6;&#x662F;XAxis &#x548C;YAxis&#x7684;&#x57FA;&#x7C7B;</p>
<h2 id="X&#x8F74;XAxis"><a href="#X&#x8F74;XAxis" class="headerlink" title="X&#x8F74;XAxis"></a>X&#x8F74;XAxis</h2><p>XAxis &#x662F;AxisBase&#x7684;&#x5B50;&#x7C7B;&#x3002;<br>XAxis &#x7C7B;&#x662F;&#x6240;&#x6709;&#x7684;&#x6570;&#x636E;&#x548C;&#x4FE1;&#x606F;&#x7684;&#x5BB9;&#x5668;&#x4E0E;&#x6C34;&#x5E73;&#x8F74;&#x6709;&#x5173;&#x3002;&#x3002;XAxis&#x663E;&#x793A;&#x4EC0;&#x4E48;&#x662F;&#x4EA4;&#x7ED9;ChartData&#x5BF9;&#x8C61;&#x4F5C;&#x4E3A;&#x4E00;&#x4E2A;ArrayList<string> &#x6216;&#x8005;String[]&#x3002;<br>XAxis&#x7C7B;&#x5141;&#x8BB8;&#x81EA;&#x5B9A;&#x4E49;&#x6837;&#x5F0F;&#x548C;&#x4EE5;&#x4E0B;&#x90E8;&#x5206;:<br>&#x6C34;&#x5E73;&#x5BF9;&#x9F50;&#x6807;&#x7B7E;&#x7ED8;&#x5236;,&#x5176;&#x4E2D;&#x5305;&#x542B;&#x8F74;&#x63CF;&#x8FF0;&#x503C;,&#x4E3A;&#x56FE;&#x8868;X&#x8F74;&#x63D0;&#x4F9B;&#x7684;&#x6570;&#x636E;&#x5BF9;&#x8C61;&#x8BBE;&#x7F6E;&#x3002;<br>&#x5728;&#x6807;&#x7B7E;&#x65C1;&#x8FB9;&#x4E0E;&#x6807;&#x7B7E;&#x5E73;&#x884C;&#x7ED8;&#x5236;&#x4E86;&#x4E00;&#x4E2A;&#x201C;axis-line&#x201D;&#x3002;<br>&#x6BCF;&#x4E2A;&#x5728;&#x5782;&#x76F4;&#x65B9;&#x5411;&#x5750;&#x6807;&#x8F74;&#x6807;&#x7B7E;&#x7684;&#x7F51;&#x683C;&#x7EBF;&#x3002;</string></p>
<h2 id="Y&#x8F74;YAxis"><a href="#Y&#x8F74;YAxis" class="headerlink" title="Y&#x8F74;YAxis"></a>Y&#x8F74;YAxis</h2><p>YAxis &#x662F;AxisBase&#x7684;&#x5B50;&#x7C7B;&#x3002;<br>YAxis &#x7C7B;&#x662F;&#x4E0E;&#x5782;&#x76F4;&#x8F74;&#x76F8;&#x5173;&#x7684;&#x6240;&#x6709;&#x6570;&#x636E;&#x548C;&#x4FE1;&#x606F;&#x5BB9;&#x5668;&#xFF0C;&#x4E0E;&#x5DE6;&#x8FB9;&#x53F3;&#x8FB9;&#x5782;&#x76F4;&#x7684;&#x8F74;&#x76F8;&#x5173;&#x3002;RadarChart &#x53EA;&#x6709;&#x4E00;&#x4E2A;Y&#x8F74;&#xFF0C;&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x56FE;&#x6807;&#x7684;&#x4E24;&#x4E2A;&#x8F74;&#x90FD;&#x542F;&#x7528;&#x7ED8;&#x5236;&#x3002;</p>
<h2 id="zeroline"><a href="#zeroline" class="headerlink" title="zeroline"></a>zeroline</h2><p>&#x9664;&#x4E86;&#x7F51;&#x683C;&#x7EBF;&#xFF0C;&#x5728;&#x6C34;&#x5E73;&#x65B9;&#x5411;Y&#x8F74;&#x7684;&#x6BCF;&#x4E2A;&#x503C;&#xFF0C;&#x6709;&#x6240;&#x8C13;&#x7684;zeroline&#xFF0C;&#x8FD9;&#x662F;&#x5728;0&#x4F4D;&#x7F6E;&#x8F74;&#x7EBF;&#x4E0A;&#x503C;&#x7ED8;&#x5236;&#x7684;&#xFF0C;&#x662F;&#x7C7B;&#x4F3C;&#x4E8E;&#x7F51;&#x683C;&#x7EBF;&#xFF0C;&#x4F46;&#x53EF;&#x4EE5;&#x5355;&#x72EC;&#x914D;&#x7F6E;&#x3002;</p>
<h2 id="LimitLine-&#x7C7B;"><a href="#LimitLine-&#x7C7B;" class="headerlink" title="LimitLine &#x7C7B;"></a>LimitLine &#x7C7B;</h2><p>&#x4E24;&#x8F74;&#x652F;&#x6301;&#xFF0C;&#x6240;&#x8C13;LimitLines&#x5141;&#x8BB8;&#x663E;&#x793A;&#x7279;&#x6B8A;&#x4FE1;&#x606F;,&#x5982;&#x8FB9;&#x754C;&#x6216;&#x9650;&#x5236;&#x3002;LimitLine&#x5728;&#x6C34;&#x5E73;&#x65B9;&#x5411;&#x65F6;&#x6DFB;&#x52A0;&#x5230;YAxis,&#x800C;&#x5728;&#x5782;&#x76F4;&#x65B9;&#x5411;&#x65F6;&#x6DFB;&#x52A0;&#x5230;XAxis&#x3002;&#x8FD9;&#x662F;&#x5982;&#x4F55;&#x4ECE;&#x8F74;&#x6DFB;&#x52A0;&#x548C;&#x5220;&#x9664;LimitLines</p>
<ul>
<li><code>addLimitLine(LimitLine l)</code>:&#x5728;&#x8F74;&#x4E0A;&#x6DFB;&#x52A0;&#x65B0;&#x7684; LimitLine</li>
<li><code>removeLimitLine(LimitLine l)</code>:&#x4ECE;&#x8F74;&#x4E0A;&#x79FB;&#x9664; LimitLine</li>
<li><code>setDrawLimitLinesBehindData(boolean enabled)</code>:&#x5141;&#x8BB8;&#x63A7;&#x5236;LimitLines&#x4E4B;&#x95F4;&#x7684;z&#x8F74;&#x4E0A;&#x7684;&#x5B9E;&#x9645;&#x7684;&#x6570;&#x636E;&#x987A;&#x5E8F;&#x3002;&#x5982;&#x679C;&#x8BBE;&#x7F6E;&#x4E3A;true,LimitLines&#x5728;&#x771F;&#x5B9E;&#x6570;&#x636E;&#x540E;&#x8FB9;&#x7ED8;&#x5236;&#xFF0C;,&#x5426;&#x5219;&#x5728;&#x4E0A;&#x9762;&#x3002;&#x9ED8;&#x8BA4;false</li>
</ul>
<h1 id="&#x5E38;&#x89C1;&#x95EE;&#x9898;"><a href="#&#x5E38;&#x89C1;&#x95EE;&#x9898;" class="headerlink" title="&#x5E38;&#x89C1;&#x95EE;&#x9898;"></a>&#x5E38;&#x89C1;&#x95EE;&#x9898;</h1><h2 id="&#x663E;&#x793A;&#x9690;&#x85CF;Y&#x8F74;&#x7EBF;&#x53CA;&#x81EA;&#x5B9A;&#x4E49;&#x8F74;&#x7EBF;&#x7684;&#x663E;&#x793A;&#x6837;&#x5F0F;"><a href="#&#x663E;&#x793A;&#x9690;&#x85CF;Y&#x8F74;&#x7EBF;&#x53CA;&#x81EA;&#x5B9A;&#x4E49;&#x8F74;&#x7EBF;&#x7684;&#x663E;&#x793A;&#x6837;&#x5F0F;" class="headerlink" title="&#x663E;&#x793A;&#x9690;&#x85CF;Y&#x8F74;&#x7EBF;&#x53CA;&#x81EA;&#x5B9A;&#x4E49;&#x8F74;&#x7EBF;&#x7684;&#x663E;&#x793A;&#x6837;&#x5F0F;"></a>&#x663E;&#x793A;&#x9690;&#x85CF;Y&#x8F74;&#x7EBF;&#x53CA;&#x81EA;&#x5B9A;&#x4E49;&#x8F74;&#x7EBF;&#x7684;&#x663E;&#x793A;&#x6837;&#x5F0F;</h2><ul>
<li><code>mChart.getAxisLeft().setEnabled(false)</code>:&#x9690;&#x85CF;Y&#x8F74;&#x5DE6;&#x8FB9;&#x8F74;&#x7EBF;&#xFF0C;&#x6B64;&#x65F6;&#x6807;&#x7B7E;&#x6570;&#x5B57;&#x4E5F;&#x9690;&#x85CF;</li>
<li><code>mChart.getAxisRight().setEnabled(false)</code>:&#x9690;&#x85CF;Y&#x8F74;&#x53F3;&#x8FB9;&#x8F74;&#x7EBF;&#xFF0C;&#x6B64;&#x65F6;&#x6807;&#x7B7E;&#x6570;&#x5B57;&#x4E5F;&#x9690;&#x85CF;  </li>
<li><code>mChart.getAxisRight().setDrawAxisLine(false)</code>:&#x5982;&#x679C;&#x60F3;&#x9690;&#x85CF;&#x8F74;&#x7EBF;&#x4F46;&#x662F;&#x60F3;&#x663E;&#x793A;&#x6570;&#x5B57;&#x6807;&#x7B7E;</li>
</ul>
<h2 id="Y&#x8F74;&#x7EBF;&#x6570;&#x636E;&#x6807;&#x7B7E;&#x600E;&#x4E48;&#x81EA;&#x5DF1;&#x63A7;&#x5236;&#x663E;&#x793A;&#x4E2A;&#x6570;"><a href="#Y&#x8F74;&#x7EBF;&#x6570;&#x636E;&#x6807;&#x7B7E;&#x600E;&#x4E48;&#x81EA;&#x5DF1;&#x63A7;&#x5236;&#x663E;&#x793A;&#x4E2A;&#x6570;" class="headerlink" title="Y&#x8F74;&#x7EBF;&#x6570;&#x636E;&#x6807;&#x7B7E;&#x600E;&#x4E48;&#x81EA;&#x5DF1;&#x63A7;&#x5236;&#x663E;&#x793A;&#x4E2A;&#x6570;"></a>Y&#x8F74;&#x7EBF;&#x6570;&#x636E;&#x6807;&#x7B7E;&#x600E;&#x4E48;&#x81EA;&#x5DF1;&#x63A7;&#x5236;&#x663E;&#x793A;&#x4E2A;&#x6570;</h2><ul>
<li><code>mChart.getAxisLeft().setLabelCount(8, false)</code>:&#x6B64;&#x65F6;&#x8BBE;&#x7F6E;&#x4E86;&#x5206;8&#x4E2A;&#xFF0C;&#x53EF;&#x6839;&#x636E;&#x81EA;&#x5DF1;&#x559C;&#x597D;&#x8BBE;&#x7F6E;</li>
</ul>
<h2 id="&#x8BBE;&#x7F6E;&#x8F74;&#x7EBF;&#x989C;&#x8272;&#xFF0C;&#x5BBD;&#x5EA6;&#x7B49;&#x4FE1;&#x606F;"><a href="#&#x8BBE;&#x7F6E;&#x8F74;&#x7EBF;&#x989C;&#x8272;&#xFF0C;&#x5BBD;&#x5EA6;&#x7B49;&#x4FE1;&#x606F;" class="headerlink" title="&#x8BBE;&#x7F6E;&#x8F74;&#x7EBF;&#x989C;&#x8272;&#xFF0C;&#x5BBD;&#x5EA6;&#x7B49;&#x4FE1;&#x606F;"></a>&#x8BBE;&#x7F6E;&#x8F74;&#x7EBF;&#x989C;&#x8272;&#xFF0C;&#x5BBD;&#x5EA6;&#x7B49;&#x4FE1;&#x606F;</h2><figure class="highlight jboss-cli"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">YAxis leftAxis = mChart.getAxisLeft<span class="params">()</span>;</span><br><span class="line"><span class="string">//</span> &#x663E;&#x793A;&#x8F74;&#x7EBF;&#x5185;&#x90E8;INSIDE_CHART  </span><br><span class="line">leftAxis.<span class="keyword">set</span>Position<span class="params">(YAxisLabelPosition.OUTSIDE_CHART)</span>;</span><br><span class="line"><span class="string">//</span> &#x8BBE;&#x7F6E;&#x8F74;&#x7EBF;&#x989C;&#x8272;</span><br><span class="line">leftAxis.<span class="keyword">set</span>AxisLineColor<span class="params">(Color.parseColor(&#x201C;#ff0000&#x201D;)</span>);</span><br><span class="line"><span class="string">//</span> &#x8BBE;&#x7F6E;&#x8F74;&#x7EBF;&#x5BBD;&#x5EA6;</span><br><span class="line">leftAxis.<span class="keyword">set</span>AxisLineWidth<span class="params">(1)</span>; </span><br><span class="line"><span class="string">//</span> &#x8BBE;&#x7F6E;y&#x8F74;&#x6807;&#x7B7E;&#x5B57;&#x4F53;&#x5927;&#x5C0F; </span><br><span class="line">leftAxis.<span class="keyword">set</span>TextSize<span class="params">(20)</span>;</span><br><span class="line"><span class="string">//</span> &#x8BBE;&#x7F6E;&#x81EA;&#x5B9A;&#x4E49;&#x5B57;&#x4F53;</span><br><span class="line">leftAxis.<span class="keyword">set</span>Typeface<span class="params">()</span>; </span><br><span class="line"><span class="string">//</span> &#x8BBE;&#x7F6E;&#x662F;&#x5426;&#x663E;&#x793A;&#x7F51;&#x683C;&#x7EBF;</span><br><span class="line">leftAxis.<span class="keyword">set</span>DrawGridLines<span class="params">(Boolean)</span>;</span><br></pre></td></tr></tbody></table></figure>
<h2 id="&#x81EA;&#x5B9A;&#x4E49;Y&#x8F74;&#x65B9;&#x5411;&#x4E0A;&#x7684;&#x503C;"><a href="#&#x81EA;&#x5B9A;&#x4E49;Y&#x8F74;&#x65B9;&#x5411;&#x4E0A;&#x7684;&#x503C;" class="headerlink" title="&#x81EA;&#x5B9A;&#x4E49;Y&#x8F74;&#x65B9;&#x5411;&#x4E0A;&#x7684;&#x503C;"></a>&#x81EA;&#x5B9A;&#x4E49;Y&#x8F74;&#x65B9;&#x5411;&#x4E0A;&#x7684;&#x503C;</h2><p>&#x91CD;&#x5199;ValueFormatter&#xFF0C;&#x4F7F;&#x7528;DataSet.setValueFormatter&#x8FDB;&#x884C;&#x8BBE;&#x7F6E;<br></p><figure class="highlight aspectj"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">CustomerValueFormatter</span> <span class="keyword">implements</span> <span class="title">ValueFormatter</span> </span>{</span><br><span class="line"></span><br><span class="line">    <span class="keyword">private</span> DecimalFormat mFormat;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="title">CustomerValueFormatter</span><span class="params">()</span> </span>{</span><br><span class="line">        <span class="comment">// &#x6B64;&#x5904;&#x662F;&#x663E;&#x793A;&#x6570;&#x636E;&#x7684;&#x65B9;&#x5F0F;&#xFF0C;&#x663E;&#x793A;&#x6574;&#x578B;&#x6216;&#x8005;&#x5C0F;&#x6570;&#x540E;&#x9762;&#x5C0F;&#x6570;&#x4F4D;&#x6570;&#x81EA;&#x5DF1;&#x968F;&#x610F;&#x786E;&#x5B9A;</span></span><br><span class="line">        mFormat = <span class="keyword">new</span> DecimalFormat(<span class="string">&quot;###,###,###,##0&quot;</span>);</span><br><span class="line">    }</span><br><span class="line"></span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="keyword">public</span> <span class="function">String <span class="title">getFormattedValue</span><span class="params">(<span class="keyword">float</span> value, Entry entry, <span class="keyword">int</span> dataSetIndex, ViewPortHandler viewPortHandler)</span> </span>{</span><br><span class="line">		<span class="comment">// &#x6570;&#x636E;&#x524D;&#x6216;&#x8005;&#x540E;&#x53EF;&#x6839;&#x636E;&#x81EA;&#x5DF1;&#x60F3;&#x8981;&#x663E;&#x793A;&#x7684;&#x65B9;&#x5F0F;&#x6DFB;&#x52A0;</span></span><br><span class="line">        <span class="function"><span class="keyword">return</span> mFormat.<span class="title">format</span><span class="params">(value)</span></span>;</span><br><span class="line">    }</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure><p></p>
<h2 id="&#x81EA;&#x5B9A;&#x4E49;Y&#x8F74;&#x5750;&#x6807;&#x663E;&#x793A;&#x7684;&#x503C;"><a href="#&#x81EA;&#x5B9A;&#x4E49;Y&#x8F74;&#x5750;&#x6807;&#x663E;&#x793A;&#x7684;&#x503C;" class="headerlink" title="&#x81EA;&#x5B9A;&#x4E49;Y&#x8F74;&#x5750;&#x6807;&#x663E;&#x793A;&#x7684;&#x503C;"></a>&#x81EA;&#x5B9A;&#x4E49;Y&#x8F74;&#x5750;&#x6807;&#x663E;&#x793A;&#x7684;&#x503C;</h2><p>&#x91CD;&#x5199;YAxisValueFormatter&#xFF0C;&#x4F7F;&#x7528;YAxis.setValueFormatter&#x8BBE;&#x7F6E;<br></p><figure class="highlight java"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">CustomerValueFormatter</span> <span class="keyword">implements</span> <span class="title">YAxisValueFormatter</span> </span>{</span><br><span class="line"></span><br><span class="line">    <span class="keyword">private</span> DecimalFormat mFormat;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">public</span> <span class="title">CustomerValueFormatter</span><span class="params">()</span> </span>{</span><br><span class="line">        mFormat = <span class="keyword">new</span> DecimalFormat(<span class="string">&quot;###,###,###,##0&quot;</span>);</span><br><span class="line">    }</span><br><span class="line"></span><br><span class="line">    <span class="meta">@Override</span></span><br><span class="line">    <span class="function"><span class="keyword">public</span> String <span class="title">getFormattedValue</span><span class="params">(<span class="keyword">float</span> value, YAxis yAxis)</span> </span>{</span><br><span class="line">        <span class="keyword">return</span> <span class="string">&quot;&#xFFE5;&quot;</span>+mFormat.format(value);</span><br><span class="line">    }</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure><p></p>
<h2 id="&#x81EA;&#x5B9A;&#x4E49;X&#x8F74;&#x5750;&#x6807;&#x663E;&#x793A;&#x7684;&#x503C;"><a href="#&#x81EA;&#x5B9A;&#x4E49;X&#x8F74;&#x5750;&#x6807;&#x663E;&#x793A;&#x7684;&#x503C;" class="headerlink" title="&#x81EA;&#x5B9A;&#x4E49;X&#x8F74;&#x5750;&#x6807;&#x663E;&#x793A;&#x7684;&#x503C;"></a>&#x81EA;&#x5B9A;&#x4E49;X&#x8F74;&#x5750;&#x6807;&#x663E;&#x793A;&#x7684;&#x503C;</h2><p>&#x91CD;&#x5199;XAxisValueFormatter&#xFF0C;&#x4F7F;&#x7528;XAxis.setValueFormatter&#x8BBE;&#x7F6E;</p>
<h2 id="&#x5C06;x&#x8F74;&#x6807;&#x7B7E;&#x503E;&#x659C;&#x663E;&#x793A;"><a href="#&#x5C06;x&#x8F74;&#x6807;&#x7B7E;&#x503E;&#x659C;&#x663E;&#x793A;" class="headerlink" title="&#x5C06;x&#x8F74;&#x6807;&#x7B7E;&#x503E;&#x659C;&#x663E;&#x793A;"></a>&#x5C06;x&#x8F74;&#x6807;&#x7B7E;&#x503E;&#x659C;&#x663E;&#x793A;</h2><figure class="highlight jboss-cli"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">XAxis xl = mChart.getXAxis<span class="params">()</span>;</span><br><span class="line"><span class="string">//</span> &#x8BBE;&#x7F6E;x&#x8F74;&#x5B57;&#x4F53;&#x663E;&#x793A;&#x89D2;&#x5EA6;</span><br><span class="line">xl.<span class="keyword">set</span>LabelRotationAngle<span class="params">(-20)</span>;</span><br><span class="line"><span class="string">//</span> &#x8BBE;&#x7F6E;X&#x8F74;&#x7684;&#x4F4D;&#x7F6E;TOP, BOTTOM, BOTH_SIDED, TOP_INSIDE, BOTTOM_INSIDE</span><br><span class="line">xl.<span class="keyword">set</span>Position<span class="params">(XAxisPosition.BOTTOM)</span>;</span><br><span class="line"><span class="string">//</span> &#x8BBE;&#x7F6E;Lable&#x4E4B;&#x95F4;&#x7684;&#x8DDD;&#x79BB;&#xFF08;&#x5B57;&#x7B26;&#xFF09;&#xFF0C;&#x5C0F;&#x4E8E;&#x8DDD;&#x79BB;&#x5C06;&#x4E0D;&#x663E;&#x793A;&#xFF0C;&#x9700;&#x8981;&#x653E;&#x5927;&#x56FE;&#x6807;&#x624D;&#x80FD;&#x770B;&#x5230;</span><br><span class="line">xl.<span class="keyword">set</span>SpaceBetweenLabels<span class="params">(int spaceCharacters)</span></span><br></pre></td></tr></tbody></table></figure>
<h2 id="&#x8BBE;&#x7F6E;&#x4E00;&#x9875;&#x6570;&#x636E;&#x70B9;&#x6570;"><a href="#&#x8BBE;&#x7F6E;&#x4E00;&#x9875;&#x6570;&#x636E;&#x70B9;&#x6570;" class="headerlink" title="&#x8BBE;&#x7F6E;&#x4E00;&#x9875;&#x6570;&#x636E;&#x70B9;&#x6570;"></a>&#x8BBE;&#x7F6E;&#x4E00;&#x9875;&#x6570;&#x636E;&#x70B9;&#x6570;</h2><p><code>setVisibleXRange(float minXRange, float maxXRange)</code></p>
<h1 id="&#x8865;&#x5145;"><a href="#&#x8865;&#x5145;" class="headerlink" title="&#x8865;&#x5145;"></a>&#x8865;&#x5145;</h1><p>&#x66F4;&#x591A;&#x8BE6;&#x7EC6;&#x4ECB;&#x7ECD;&#x53EF;&#x53C2;&#x8003;</p>
<blockquote>
<ul>
<li><a href="https://github.com/Android-View/JNChartDemo" target="_blank" rel="noopener">JNChartDemo</a></li>
<li><a href="https://github.com/Android-View/ChartLib-Demo-Android" target="_blank" rel="noopener">ChartLib-Demo-Android</a></li>
<li><a href="https://jitpack.io/com/github/PhilJay/MPAndroidChart/v3.0.0-beta1/javadoc/" target="_blank" rel="noopener">API</a></li>
</ul>
</blockquote>
<script>
        document.querySelectorAll('.github-emoji')
          .forEach(el => {
            if (!el.dataset.src) { return; }
            const img = document.createElement('img');
            img.style = 'display:none !important;';
            img.src = el.dataset.src;
            img.addEventListener('error', () => {
              img.remove();
              el.style.color = 'inherit';
              el.style.backgroundImage = 'none';
              el.style.background = 'none';
            });
            img.addEventListener('load', () => {
              img.remove();
            });
            document.body.appendChild(img);
          });
      </script>
      
    </div>
    
    
    

    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>谢谢老板，请尽情用红包来蹂躏我吧！！！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/uploads/wechatpay.jpg" alt="Tiimor 微信打赏">
        <p>微信打赏</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/uploads/alipay.jpg" alt="Tiimor 支付宝打赏">
        <p>支付宝打赏</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <!-- modify by zhangwei -->
            <!-- 文章底部标签图标 -->
            <a href="/tags/Android图表/" rel="tag"><i class="menu-item-icon fa fa-tag fa-fw"></i>Android图表</a>
          
            <!-- modify by zhangwei -->
            <!-- 文章底部标签图标 -->
            <a href="/tags/MPAndroidChart/" rel="tag"><i class="menu-item-icon fa fa-tag fa-fw"></i>MPAndroidChart</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/Android数据库加密/" rel="next" title="Android数据库加密">
                <i class="fa fa-chevron-left"></i> Android数据库加密
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/Android功守道-反编译VS混淆与加壳/" rel="prev" title="Android功守道-反编译VS混淆与加壳">
                Android功守道-反编译VS混淆与加壳 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      
        <div id="gitment-container"></div>
      
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/uploads/avatar.jpg" alt="Tiimor">
            
              <p class="site-author-name" itemprop="name">Tiimor</p>
              <p class="site-description motion-element" itemprop="description">安静地做一只攻城狮。</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">41</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">6</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">56</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/VeiZhang" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://www.weibo.com/tiimor" target="_blank" title="微博">
                      
                        <i class="fa fa-fw fa-weibo"></i>微博</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://juejin.im/user/589972d0570c3500624fd791" target="_blank" title="掘金">
                      
                        <i class="fa fa-fw fa-anchor"></i>掘金</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://www.jianshu.com/u/93b886580243" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-book"></i>简书</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://wpa.qq.com/msgrd?v=3&uin=690393541&site=qq&menu=yes" target="_blank" title="QQ">
                      
                        <i class="fa fa-fw fa-qq"></i>QQ</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:tiimor@qq.com" target="_blank" title="邮箱">
                      
                        <i class="fa fa-fw fa-envelope"></i>邮箱</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#核心功能"><span class="nav-number">1.</span> <span class="nav-text">核心功能</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#图表类型"><span class="nav-number">2.</span> <span class="nav-text">图表类型</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#图表绘制"><span class="nav-number">3.</span> <span class="nav-text">图表绘制</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#XY轴绘制"><span class="nav-number">3.1.</span> <span class="nav-text">XY轴绘制</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#定义轴线样式"><span class="nav-number">3.2.</span> <span class="nav-text">定义轴线样式</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#自定义轴线的值"><span class="nav-number">3.3.</span> <span class="nav-text">自定义轴线的值</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#图表样式"><span class="nav-number">3.4.</span> <span class="nav-text">图表样式</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#打印日志"><span class="nav-number">3.5.</span> <span class="nav-text">打印日志</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#刷新"><span class="nav-number">3.6.</span> <span class="nav-text">刷新</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#图表的交互"><span class="nav-number">4.</span> <span class="nav-text">图表的交互</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#启用-禁用交互"><span class="nav-number">4.1.</span> <span class="nav-text">启用/禁用交互</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#图表的减速器"><span class="nav-number">4.2.</span> <span class="nav-text">图表的减速器</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#高亮方式"><span class="nav-number">4.3.</span> <span class="nav-text">高亮方式</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#自定义高亮符号"><span class="nav-number">4.4.</span> <span class="nav-text">自定义高亮符号</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#选择回调"><span class="nav-number">4.5.</span> <span class="nav-text">选择回调</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#手势回调"><span class="nav-number">4.6.</span> <span class="nav-text">手势回调</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#主要图表类"><span class="nav-number">5.</span> <span class="nav-text">主要图表类</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#轴AxisBase"><span class="nav-number">5.1.</span> <span class="nav-text">轴AxisBase</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#X轴XAxis"><span class="nav-number">5.2.</span> <span class="nav-text">X轴XAxis</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Y轴YAxis"><span class="nav-number">5.3.</span> <span class="nav-text">Y轴YAxis</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#zeroline"><span class="nav-number">5.4.</span> <span class="nav-text">zeroline</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#LimitLine-类"><span class="nav-number">5.5.</span> <span class="nav-text">LimitLine 类</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#常见问题"><span class="nav-number">6.</span> <span class="nav-text">常见问题</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#显示隐藏Y轴线及自定义轴线的显示样式"><span class="nav-number">6.1.</span> <span class="nav-text">显示隐藏Y轴线及自定义轴线的显示样式</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Y轴线数据标签怎么自己控制显示个数"><span class="nav-number">6.2.</span> <span class="nav-text">Y轴线数据标签怎么自己控制显示个数</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#设置轴线颜色，宽度等信息"><span class="nav-number">6.3.</span> <span class="nav-text">设置轴线颜色，宽度等信息</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#自定义Y轴方向上的值"><span class="nav-number">6.4.</span> <span class="nav-text">自定义Y轴方向上的值</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#自定义Y轴坐标显示的值"><span class="nav-number">6.5.</span> <span class="nav-text">自定义Y轴坐标显示的值</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#自定义X轴坐标显示的值"><span class="nav-number">6.6.</span> <span class="nav-text">自定义X轴坐标显示的值</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#将x轴标签倾斜显示"><span class="nav-number">6.7.</span> <span class="nav-text">将x轴标签倾斜显示</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#设置一页数据点数"><span class="nav-number">6.8.</span> <span class="nav-text">设置一页数据点数</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#补充"><span class="nav-number">7.</span> <span class="nav-text">补充</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; 2017 &mdash; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Tiimor</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a></div>




        
<div class="busuanzi-count">
  <!-- modify by zhangwei -->
  <!-- 修改不蒜子统计脚本 -->
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv">
      <i class="fa fa-user"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      
    </span>
  
</div>



<script>
  	var _mtac = {};
  	(function() {
  		var mta = document.createElement("script");
  		mta.src = "https://pingjs.qq.com/h5/stats.js?v2.0.4";
  		mta.setAttribute("name", "MTAH5");
  		mta.setAttribute("sid", "500425805");

  		var s = document.getElementsByTagName("script")[0];
  		s.parentNode.insertBefore(mta, s);
  	})();
</script>


  <script type="text/javascript">
    (function() {
      var hm = document.createElement("script");
      hm.src = "//tajs.qq.com/stats?sId=61441764";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
          <span id="scrollpercent"><span>0</span>%</span>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  







<!-- LOCAL: You can save these files to your site and update links -->
    
        
        <link rel="stylesheet" href="https://aimingoo.github.io/gitmint/style/default.css">
        <script src="https://aimingoo.github.io/gitmint/dist/gitmint.browser.js"></script>
    
<!-- END LOCAL -->

    

    
      <script type="text/javascript">
      function renderGitment(){
        var gitment = new Gitmint({
            <!-- modify by zhangwei -->
            <!-- 修复gitment评论页初始化错误@tiimor -->
            id: '1512887386000', 
            owner: 'VeiZhang',
            repo: 'veizhang.github.io',
            
            lang: "" || navigator.language || navigator.systemLanguage || navigator.userLanguage,
            
            oauth: {
            
            
                client_secret: '9919bc61413a89ea3eb156910d282e3103093e32',
            
                client_id: 'f08924ca58e61d6f51f4'
            }});
        gitment.render('gitment-container');
      }

      
      renderGitment();
      
      </script>
    







  




  
  
  
  <link rel="stylesheet" href="/lib/algolia-instant-search/instantsearch.min.css">

  
  
  <script src="/lib/algolia-instant-search/instantsearch.min.js"></script>
  

  <script src="/js/src/algolia-search.js?v=5.1.4"></script>



  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
  <script>AV.initialize("7aBs9I9Y3PjoN6ueX5J3AYQW-gzGzoHsz", "kboycyzaPNAYcUW8AkF3edeW");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
  

  

  

  

  
  <!-- modify by zhangwei -->
  <!-- 动态时间小人 -->
  <!-- modify by zhangwei -->
<!-- 动态时间小人 -->
<!-- z-index -1 表示在最底层，不能悬浮也不能点击 -->
<!-- z-index auto 可以点击 -->
<!-- z-index 9999 无限大时，总是在最上层，会影响其他悬浮框 -->
<div id="dg" style="z-index: auto; position: fixed ! important; right: 0px; top: 0px;">  
    <table width 100% style="position: absolute; width:260px; right: 0px; top: 0px;">  
		<div>
			<embed wmode="transparent" src="http://cdn.tiimor.cn/images/dynamic_time.swf" quality="high" bgcolor="#ffffff" width="160" height="70" name="honehoneclock" align="middle" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
		</div>
    </table>  
</div>
  
</body>
</html>
